#pragma once

#include <vector>

#include "ICleanableObserver.h"
#include "TextureUnits.h"
#include "TextureUnitGL3x.h"

#include "Device.h"

namespace Renderer
{
	namespace GL3x
	{
		class TextureUnitsGL3x : public TextureUnits, public ICleanableObserver
		{
		public:

			TextureUnitsGL3x();

			virtual TextureUnit* GetTextureUnitAt(int index) const;

			virtual void SetTextureUnitAt(int index, TextureUnit* textureUnit);
			
			virtual int GetCount();

			void Clean();

			void NotifyDirty(ICleanable* value);

		private:
			std::vector<TextureUnit*> _textureUnits;
			std::vector<ICleanable*> _dirtyTextureUnits;
			TextureUnitGL3x* _lastTextureUnit;
		};
	}
}